#!/bin/bash

# 检查是否传入了至少两个参数
if [ "$#" -lt 2 ]; then
    echo "Usage: $0 path/to/arm.segy path/to/x86.segy error_threshold(float,optional)
    relative_error_threshold(float,optional) start_trace(int,optional)"
    echo "Doc: 1,param1 is arm.segy's file path
               2,param2 is x86.segy's file path
               3,param3,You can set a absolute error threshold(float),default[1e-5]
               4,param4,You can set a relative error threshold(float).default[0.001]
               5,param5,You can set a integer n to print [n-n+9] trace header,default[0-9]"
    echo "If You Don't Know ,Now You Know!"
    exit 1
fi

# 定义参数变量
param1="$1"
param2="$2"
param3="$3"
param4="$4"
param5="$5"

# 判断是否有第三个参数，如果没有，则默认为0
if [ "$#" -gt 4 ]; then
    param3="$3"
elif [ "$#" -gt 5 ]; then
    param4="$4"
elif [ "$#" -gt 6 ]; then
    param5="$5"

fi

# 执行 Python 脚本并传递参数
python segyv2.0.py "$param1" "$param2" "$param3" "$param4" "$param5"
